<template>
	<view style="height: 120rpx;">
		<view class="store-bg">
			<!-- <view style="position: absolute;width: 100%;">
				<image src="./image/bg.png" style="width: 100%;height: 120rpx;">
			</view> -->
			<view style="z-index: 100000;height: 120rpx;width: 710rpx;padding: 0 20rpx;" class="u-flex u-row-between">
				<view>
					<priceStyle :info="info" :size="40" :on="true" color="#FFF" />
				</view>
				<view>
					<u-count-down :time="second" format="DD-HH:mm:ss" autoStart @change="onChange">
						<view style="height: 120rpx;" class="u-flex u-row-right">

							<view class="time">
								<view style="width: 60rpx;">
									<text class="time__custom__item" style="color: #FFF;">{{ timeData.days}}天</text>
								</view>
								<view class="time__custom">
									<text
										class="time__custom__item">{{ timeData.hours>10?timeData.hours:'0'+timeData.hours}}</text>
								</view>
								<text class="time__doc">:</text>
								<view class="time__custom">
									<text class="time__custom__item">{{ timeData.minutes }}</text>
								</view>
								<text class="time__doc">:</text>
								<view class="time__custom">
									<text class="time__custom__item">{{ timeData.seconds }}</text>
								</view>
							</view>
						</view>
					</u-count-down>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	import priceStyle from '@/components/priceStyle.vue'
	export default {
		components: {
			priceStyle
		},
		props: {
			info: {
				type: Object,
				default: () => {
					return {}
				}
			},
			second: {
				type: Number,
				default: 0
			}
		},
		data() {
			return {
				timeData: {}
			}

		},
		methods: {
			onChange(e) {
				this.timeData = e
			},

		}
	}
</script>

<style lang="scss">
	.time {
		@include flex;
		align-items: center;

		&__custom {
			margin-top: 4px;
			width: 22px;
			height: 22px;
			background-color: #ebebe9;
			border-radius: 4px;
			/* #ifndef APP-NVUE */
			display: flex;
			/* #endif */
			justify-content: center;
			align-items: center;

			&__item {
				color: #b66536;
				font-size: 12px;
				text-align: center;
			}
		}

		&__doc {
			color: #FFF;
			padding: 0px 4px;
		}

		&__item {
			color: #b66536;
			font-size: 15px;
			margin-right: 4px;
		}
	}
</style>
